[HVM][VMX] expose PSE feature to HVM guests if PAE is turned on in
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Wed, 5 Jul 2006 09:32:08 +0000 (10:32 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Wed, 5 Jul 2006 09:32:08 +0000 (10:32 +0100)
config file, with this change, RHEL4 IA32 SMP guest can boot.
But because we don't support 4Mbytes PSE pages, so x86_32 HVM guest
can NOT use PSE feature. However user may have "pae=1" in config file,
which causes PSE feature seen by x86_32 HVM guest, and it will then use
4Mbytes PSE pages. In this case, we will have to crash x86_32 HVM.
So when running x86_32 HVM guest, user need pay attention not to have
"pae=1" in config file.

Signed-off-by: Xin Li <xin.b.li@intel.com>
Signed-off-by: Xiaohui Xin <xiaohui.xin@intel.com>
xen/arch/x86/hvm/vmx/vmx.c
xen/arch/x86/shadow.c

index e40b76ecb5571e7d4b7f63eab8dfdb34775f6ee1..df2e295acb206d8c4399aad5ec3267728659e3bd 100644 (file)
@@ -857,10 +857,14 @@ static void vmx_vmexit_do_cpuid(struct cpu_user_regs *regs)
 #else
             if ( v->domain->arch.ops->guest_paging_levels == PAGING_L2 )
             {
-                if ( !v->domain->arch.hvm_domain.pae_enabled )
+                if ( v->domain->arch.hvm_domain.pae_enabled )
+                    clear_bit(X86_FEATURE_PSE36, &edx);
+                else
+                {
                     clear_bit(X86_FEATURE_PAE, &edx);
-                clear_bit(X86_FEATURE_PSE, &edx);
-                clear_bit(X86_FEATURE_PSE36, &edx);
+                    clear_bit(X86_FEATURE_PSE, &edx);
+                    clear_bit(X86_FEATURE_PSE36, &edx);
+                }
             }
 #endif
 
index d2a65f51df0225b9a6d369b6637a0df4d025a523..29895195fd0c17806acc114633f4a1c0479b1647 100644 (file)
@@ -3724,7 +3724,13 @@ static inline int guest_page_fault(
     }
 
     if ( guest_l2e_get_flags(*gpl2e) & _PAGE_PSE )
+    {
+        printk("None-PAE HVM guests can NOT use PSE, "
+               "because we don't support 4MBytes PSE pages.\n");
+        printk("remove pae=1 from your config file.\n");
+        domain_crash_synchronous();
         return 0;
+    }
 
     __guest_get_l1e(v, va, gpl1e);